﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System;
using System.ComponentModel;
using System.Drawing;

namespace JAAF.UI
{
    /// <summary>
    /// The IView interface defines the properties that any user interface
    /// component (ie windows forms) must support in order to interact with 
    /// the <see cref="UIProcess"> user interface process</see> derived classes.
    /// </summary>
    public interface IView
    {
        #region Events

        event EventHandler ViewActivated;

        event EventHandler ViewDeactivated;

        event CancelEventHandler ViewClosing;

        event EventHandler ViewClosed;

        #endregion


        #region Properties

        /// <summary>
        /// Gets or sets the name of the view.
        /// Each view name within an application should be unique.
        /// </summary>
        string Name
        {
            get;
            set;
        }

        /// <summary>
        /// Provides a description of the view for displaying
        /// to the user interface.
        /// </summary>
        string Title
        {
            get;
            set;
        }

        /// <summary>
        /// Provides information on this view
        /// </summary>
        string Documentation
        {
            get;
            set;
        }

        /// <summary>
        /// Gets the <see cref="UIProcess"> user interface process this view participates in.
        /// </summary>
        UIProcess Process
        {
            get;
        }

        /// <summary>
        /// Indicates wether this UIView is visible.
        /// </summary>
        bool IsVisible
        {
            get;
        }

        /// <summary>
        /// Indicates whether this UIView is enabled
        /// and can receive the focus.
        /// </summary>
        bool IsEnabled
        {
            get;
        }

        /// <summary>
        /// Gets or sets an <see cref="Image">image</see>
        /// that provides a visual representation of the view.
        /// </summary>
        /// <remarks>
        /// This property can be used when displaying the view 
        /// inside a <see cref="IViewspace">workspace</see> that supports
        /// such visual enhancements.
        /// </remarks>
        //Image Picture
        //{
        //    get;
        //    set;
        //}

        /// <summary>
        /// Gets or sets the large <see cref="Image">image</see>
        /// that provides a visual representation of the view.
        /// </summary>
        /// <remarks>
        /// This property can be used when displaying the view 
        /// inside a <see cref="IViewspace">workspace</see> that supports
        /// such visual enhancements.
        /// </remarks>
        //Image LargePicture
        //{
        //    get;
        //    set;
        //}

        /// <summary>
        /// Gets the <see cref="IViewspace">workspace</see> that
        /// this view is displayed into.
        /// </summary>
        //IWorkspace Workspace
        //{
        //    get;
        //}

        #endregion


        #region Methods

        /// <summary>
        /// Initializes the view with the <see cref="UIProcess">user interface process</see> 
        /// it has been activated by.
        /// </summary>
        /// <remarks>
        /// When implemented by a view that can be reused across processes,
        /// the view must ensure that when this method is called, it discards any state that
        /// belongs to the previously owning process.
        /// </remarks>
        /// <param name="_oOwningProcess">The <see cref="UIProcess"/> that currently owns the view.</param>
        void Initialize(UIProcess _oOwningProcess);

        /// <summary>
        /// Forces the view to redraw itself.
        /// </summary>
        void Refresh();

        /// <summary>
        /// Closes the view
        /// </summary>
        void Close();

        /// <summary>
        /// Sets the focus to this view.
        /// </summary>
        /// <returns>
        /// True if the view accepted the focus, otherwise false.
        /// </returns>
        bool Focus();

        /// <summary>
        /// Gets an icon for the view. The icon may be used in various parts of
        /// the user interface.
        /// </summary>
        /// <param name="_IconSize">The dimensions of the requested graphic. </param>
        /// <returns>A <see cref="System.Drawing.Image"/> of the view's icon.</returns>
        //Image GetIcon(Size? _IconSize = null);

        #endregion
    }
}
